#ifndef MESSAGE_H
#define MESSAGE_H

#include <QString>
#include <QDate>

/**
 * @brief The Message class
 * 短信类
 * 保存短信中心的号码，发送or接受的号码，内容
 *
 */

class Message
{
public:
    Message(){}
    Message(const QString &addr, const QString & phone, const QString &content) :
        m_addr(addr),
        m_phone(phone),
        m_context(content),
        m_date(QDate::currentDate().toString("yyyy-MM-dd")),
        m_time(QTime::currentTime().toString("hh:mm:ss"))
    {
        m_context += m_date + "|";
        m_context += m_time;

    }
    ~Message(){}
    int len() const {
        return m_context.length();
    }
    const QString& getAddr() const {
        return m_addr;
    }
    const QString& getPhone() const {
        return m_phone;
    }
    const QString& getContent() const {
        return m_context;
    }

    QString getContent() {
        return m_context;
    }

    const QString& getDate() const{
        return m_date;
    }
    const QString& getTime() const {
        return m_time;
    }

private:
    QString m_addr;
    QString m_phone;
    QString m_context;
    QString m_date;
    QString m_time;
};

#endif // MESSAGE_H
